<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>输出指定范围内的随机数</p>
min:
<input type="text" name="" id="q1"><br/>
max:
<input type="text" name="" id="q2"><br/>
<button onclick="getRndInteger(x1.value,x2.value)">输出</button>
<p id="demo"></p>
<script type="text/javascript">
var x1 = document.getElementById("q1");
var x2 = document.getElementById("q2");
function getRndInteger(min,max){
	var y = Math.floor(Math.random() * (max - min) ) + Number(min);
	document.getElementById("demo").innerHTML = y;
}
</script>
</body>
</html>